package com.xjprojectc.business.service.impl;

import java.util.List;

import com.tech.framework.service.impl.BaseServiceImpl;
import com.xjprojectc.business.pojo.T_agentaccountinfo;
import com.xjprojectc.business.service.AgentaccountinfoService;


@SuppressWarnings("unchecked")
public class AgentaccountinfoServiceImpl extends BaseServiceImpl implements AgentaccountinfoService{
	
	public List<T_agentaccountinfo> getAgentaccountinfoByPager(T_agentaccountinfo agent) {
		return find(T_agentaccountinfo.class.getName()+".selectPaged", agent);
	}
	
	public List<T_agentaccountinfo> getAgentaccountinfoByList(T_agentaccountinfo agent) {
		return find(T_agentaccountinfo.class.getName()+".select", agent);
	}

	public T_agentaccountinfo getOneAgentaccountinfo(String id) {
		return (T_agentaccountinfo) find(T_agentaccountinfo.class.getName()+".selectById",id).get(0);
	}

	public int getPageCount(T_agentaccountinfo agent) {
		return Integer.parseInt(find(T_agentaccountinfo.class.getName()+".selectCount",agent).get(0).toString());
	}
	
	@SuppressWarnings("unchecked")
	public boolean addAgentaccountinfo(T_agentaccountinfo agent) {
		boolean bool = false;
		try {
			insert(agent);
			bool = true;
		} catch (Exception e) {
		}
		return bool;
	}

	public boolean delAgentaccountinfo(T_agentaccountinfo agent) {
		boolean bool = false;
		try {
			remove(agent);
			bool = true;
		} catch (Exception e) {
		}
		return bool;
	}


	public boolean updateAgentaccountinfo(T_agentaccountinfo agent) {
		boolean bool = false;
		try {
			update(agent);
			bool = true;
		} catch (Exception e) {
		}
		return bool;
	}
	public T_agentaccountinfo getOneAgentaccountinfoByUsername(String username) {
		return (T_agentaccountinfo) find(T_agentaccountinfo.class.getName()+".selectByUsername",username).get(0);
	}

	
}
